package com.open.cloud.rbac.mapper.role;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.open.cloud.rbac.entity.role.CoreRoleUserRel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 角色用户关联表 Mapper 接口
 * </p>
 *
 * @author wangzengzhou01
 * @since 2024-12-23
 */
@Mapper
public interface CoreRoleUserRelMapper extends BaseMapper<CoreRoleUserRel> {
    /**
     * 根据userId获取roleId
     *
     * @param userId
     * @return
     */
    public List<String> selectRoleIdByUserId(@Param("userId") String userId);

    /**
     * 批量插入user与role的关联关系
     *
     * @param list
     * @return
     */
    public Integer batchInsertUserRoleRel(@Param("list") ArrayList<CoreRoleUserRel> list);
}
